package org.rambadger.command.providers;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotates a variable for runtime injection of values from the configuration file.
 *
 * @see ConfigProvider
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.FIELD, ElementType.PARAMETER})
public @interface ConfigParam {
    /**
     * Represents the path through the config file hierarchy with components separated by periods.
     * <p>
     *     Given a value of "foo.bar.baz", the annotated variable would be injected with the value of the baz field of the bar field of the foo field of the main configuration instance.
     * </p>
     * <p>
     *     This does not work with getters.
     * </p>
     * @return the path in the config file
     */
    String value();
}
